package cn.riverluoo.keywords;


public class KeyWord {
	private String[] javaKeyWords;
	private String[] xmlKeyWords;
	private String[] cssKeyWords;
	private String[] dtdKeyWords;
	private String[] xsdKeyWords;

	public KeyWord()
	{
		javaKeyWords=new String[]{"boolean","byte","char","double","float","int","long","short","void",
				"new","super","this","instanceof","null","if","else","switch","case",
				"default","do","while","for","break","continue","return","try","catch",
				"finally","throw","assert","synchronized","abstract","final","private",
				"protected","public","static","class","extends","interface","implements",
				"import","package","native","transient","volatile","true","false","String",
				"StringBuffer","StringBulider","import","Vector","Stack","HashSet","TreeSet",
				"ArrayList","LinkList","Map","Date","Calendar",
		};
		xmlKeyWords=new String[]{"xml","version","encoding"
		};
		cssKeyWords=new String[]{"html","head","body","title","base","META","link","ISINDEX","style","pre","h1",
				"h2","h3","h4","h5","h6","h7","b","i","tt","cite","em","strong","font","p",
				"br","blockquote","dl","dt","dd","ol","li","ul","div","img","hr","table",
				"tr","td","th","frameset","noframes","frame","form","select","option",
				"textarea","input","PRE","TT","ADDRESS","SAMP","DL"};
		dtdKeyWords=new String[]{"xml","version","encoding","ELEMENT ","PCDATA","ATTLIST ","CDATA ","REQUIRED","SYSTEM ","PUBLIC ","DTD-URL",
				"required","implied","fix","type"};
		xsdKeyWords=new String[]{"xml","version","encoding","xs","schema","xmlns","targetNamespace","elementFormDefault","element","name","complexType",
				"sequence","type","string"};
	}
	public boolean isKeyWord(String word,String lan)
	{
		if(lan.equals("java"))
		{
			for(int i=0;i<javaKeyWords.length;i++)
			{
				if(javaKeyWords[i].equals(word))
				{
					return true;
				}
			}
		}
		if(lan.equals("xml"))
		{

			for(int i=0;i<xmlKeyWords.length;i++)
			{
				if(xmlKeyWords[i].equals(word))
				{
					return true;
				}
			}
		}
		if(lan.equals("css"))
		{

			for(int i=0;i<cssKeyWords.length;i++)
			{
				if(cssKeyWords[i].equals(word))
				{
					return true;
				}
			}
		}
		if(lan.equals("dtd"))
		{

			for(int i=0;i<dtdKeyWords.length;i++)
			{
				if(dtdKeyWords[i].equals(word))
				{
					return true;
				}
			}
		}
		if(lan.equals("xsd"))
		{

			for(int i=0;i<xsdKeyWords.length;i++)
			{
				if(xsdKeyWords[i].equals(word))
				{
					return true;
				}
			}
		}
		return false;
	}
}
